<? //SUPPLIERS_edit.php;
$msg="";
include("SUPPLIERS_session.php");
if(isset($_POST["submit"]))
{
	$pk_val = $_POST["pk_val"];
	$data_class = new SUPPLIERS();$data_class->setSupplierID($_POST["SupplierID"]);
	$data_class->setCompanyName($_POST["CompanyName"]);
	$data_class->setContactFName($_POST["ContactFName"]);
	$data_class->setContactLName($_POST["ContactLName"]);
	$data_class->setContactTitle($_POST["ContactTitle"]);
	$data_class->setAddress1($_POST["Address1"]);
	$data_class->setAddress2($_POST["Address2"]);
	$data_class->setCity($_POST["City"]);
	$data_class->setState($_POST["State"]);
	$data_class->setPostalCode($_POST["PostalCode"]);
	$data_class->setCountry($_POST["Country"]);
	$data_class->setPhone($_POST["Phone"]);
	$data_class->setFax($_POST["Fax"]);
	$data_class->setEmail($_POST["Email"]);
	$data_class->setWebSite($_POST["WebSite"]);
	$data_class->setPaymentMethods($_POST["PaymentMethods"]);
	$data_class->setDiscountType($_POST["DiscountType"]);
	$data_class->setDiscountRate($_POST["DiscountRate"]);
	$data_class->setTypeGoods($_POST["TypeGoods"]);
	$data_class->setDiscountAvailable($_POST["DiscountAvailable"]);
	$data_class->setCurrentOrder($_POST["CurrentOrder"]);
	$data_class->setCustomerID($_POST["CustomerID"]);
	$data_class->setSizeURL($_POST["SizeURL"]);
	$data_class->setLogo($_POST["Logo"]);
	$data_class->setRanking($_POST["Ranking"]);
	$data_class->setNote($_POST["Note"]);
	$edit_class = new SessionSUPPLIERS();
	$edit_class->update($edit_class);
	$msg = "Success Update Data";
	$current_data = $update_class->find($pk_val);
}
else
{
	$pk_val = $_GET["id"];
	$search_class = new SessionSUPPLIERS();
	$current_data = $search_class->find($pk_val);
}
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Edit Data To Table SUPPLIERS</title>
<script src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery_validate.js"></script>
  <script>
  $(document).ready(function(){
    $("#form").validate();
  });
  </script>
</head>

<body>
<h2><?=$msg;?></h2><form name="form1" id="form" method="post" action="<?=$_SERVER["PHP_SELF"];?>">
  <table width="657" border="1">
    <tr>
      <td colspan="3">EDIT DATA</td>
    </tr><tr>
      <td width="97">SupplierID</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="SupplierID" value="<?=$current_data->SupplierID;?>" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">CompanyName</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="CompanyName" value="<?=$current_data->CompanyName;?>" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">ContactFName</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="ContactFName" value="<?=$current_data->ContactFName;?>" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">ContactLName</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="ContactLName" value="<?=$current_data->ContactLName;?>" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">ContactTitle</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="ContactTitle" value="<?=$current_data->ContactTitle;?>" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">Address1</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="Address1" value="<?=$current_data->Address1;?>" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">Address2</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="Address2" value="<?=$current_data->Address2;?>" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">City</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="City" value="<?=$current_data->City;?>" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">State</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="State" value="<?=$current_data->State;?>" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">PostalCode</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="PostalCode" value="<?=$current_data->PostalCode;?>" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">Country</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="Country" value="<?=$current_data->Country;?>" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">Phone</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="Phone" value="<?=$current_data->Phone;?>" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">Fax</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="Fax" value="<?=$current_data->Fax;?>" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">Email</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="Email" value="<?=$current_data->Email;?>" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">WebSite</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="WebSite" value="<?=$current_data->WebSite;?>" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">PaymentMethods</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="PaymentMethods" value="<?=$current_data->PaymentMethods;?>" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">DiscountType</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="DiscountType" value="<?=$current_data->DiscountType;?>" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">DiscountRate</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="DiscountRate" value="<?=$current_data->DiscountRate;?>" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">TypeGoods</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="TypeGoods" value="<?=$current_data->TypeGoods;?>" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">DiscountAvailable</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="DiscountAvailable" value="<?=$current_data->DiscountAvailable;?>" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">CurrentOrder</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="CurrentOrder" value="<?=$current_data->CurrentOrder;?>" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">CustomerID</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="CustomerID" value="<?=$current_data->CustomerID;?>" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">SizeURL</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="SizeURL" value="<?=$current_data->SizeURL;?>" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">Logo</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="Logo" value="<?=$current_data->Logo;?>" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">Ranking</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="Ranking" value="<?=$current_data->Ranking;?>" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">Note</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="Note" value="<?=$current_data->Note;?>" class="required " minlength="0" maxlength="25" /></td>
    </tr> <tr>
      <td></td>
      <td></td>
      <td>
	   <input type="hidden" name="pk_val" value="<?=$pk_val;?>" />
	  <input type="submit" name="submit" value="Edit" /></td>
    </tr>
   
  </table>
</form>
</body>
</html>